<template>
  <div class="dashboard-container">
    <div class="app-container">

      <el-card>
        <h2 class="centInfo">月人事报表</h2>
        <el-tabs v-model="activeName" class="infoPosin">
          <el-tab-pane name="first">
            <span slot="label">考勤统计</span>
            <component :is="reportForm" :show-height="showHeight" :month="this.$route.params.month" @archivingReportForm="archivingReportForm" />
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </div>
  </div>
</template>

<script>
import { fileUpdate } from '@/api/attendances'
import reportForm from './components/reportForm'
export default {
  components: {
    reportForm
  },
  data() {
    return {
      activeName: 'first',
      showHeight: 40,
      reportForm: reportForm
    }
  },
  methods: {
    async archivingReportForm() {
      // 二次校验
      this.$$confirm('报表归档将覆盖上一次归档记录，无法恢复。', '归档确认')
      // 发请求
      await fileUpdate({ month: this.$route.params.month })
      // 提示用户
      this.$$message.success('报表归档成功')
    }
  }
}
</script>

<style>

</style>
